# vars
taskId='69863'

brqk='fea-1.0-cmn-gcm'
brprice='feat-price-sign'
brfukuan='feat-fukuan-panzj'
brmjsp='fea-1.2-srm-deposit'
brwlmaintan='feat-pricelist-maintain' # 价格跟签物料价格表维护
brsz='feat-szbaojia'
brzblistSaveAs='fea-1.3-srm-order-attash' # 招标清单另存
brqsRules='fea-1.3-srm-config-rule' # 请示模板规则配置 released
brunionPurchase="feat-union-purchange-panzj" # 联合采购建议字段优化
brclhb='cmp-release-price-house'
brflowParam='fea-1.3-srm-flow-params' # 审批参数 FlowRoleInfo
brlowPrice='fea-1.3-srm-low-price' # 评标环节异常低价报价推送造价分析
brsjgl='feat-sheJiGuanLian' # 设计关联请示文件需求
brclimport='feat-clhb-import' # 回标导入功能优化
brhotfixsrm='online-bugfix' # srm调试产线问题
brhotfixisp='cmp-bugfix' # isp调试产线问
brszzc='fea-1.5-srm-feat-SZZhucaiK2' # 市政主材审批 审批三个tab
brtimeStamp='fea-1.5-srm-feat-zclxTimeStamp' # 招采立项提交接口校验异常，仍需更新页面数据的时间戳
brbzjlink='cmp-fix-bzjlink' # 招标列表，保证金截止时间列,查看详情按钮增加逻辑判断
brchangeXie='fea-1.5-srm-changeXiePackage' # 畅写npm包接入
brtenderFields='fea-1.5-srm-tenderListAddFields' # 招标列表增加轮次和报价响应字段显示 released
brpriceLibFields='fea-1.5-srm-priceLibAddField' # 价格库列表界面增加价格库编码字段显示  released
brbzjConfiscate='hotfix-1.6.39' # 保证金没收页面点击提交报错 released
brkejianApprove='fea-1.6-srm-kejianApprove' # 科建-审批流触发条件修改
brbatchDown='fea-1.6-srm-batchDownload' # 招采详情页评标步骤回标附件模块增加批量下载功能 released

brsjLandPrecode='fea-1.6-srm-sjLandPrecode' # 设计关联文件弹窗，自动填充对应的土地预编码 released
brbzjFreePay='cmp-fix-bzj' # 保证金免缴走审批流程 保证金免缴&踏勘校验调整说明书 released
brbzjTkValidate='fea-1.6-srm-TkValidate' # 保证金免缴&踏勘校验调整说明书 released 
brpriceResubmit='hotfix-1.6.72' # 价格跟签重新提交审批 released
brclhbFix='cmp-clhb-fix' # 材料回标问题修复 上轮报价选择税率点击调整 released  rebuild checkout from cmp-release
bryearBidFields='fea-1.6-srm-yearBidFields' # 引用年度标二级页面字段调整 released
brbzjmjNoApprove='cmp-bzjmj-noApprove' # 保证金免缴取消审批 released
brfixhbResubmit='fea-1.7-srm-fix-58190' # M70A230116000026修改回标截止日期撤回修改，重新发起时无法正常提交 released
brattachOfPriceSign='fea-1.7-srm-priceSignAttachment' # 231价格跟签供应商生成报价单附件优化 released
brpriceSignFj='cmp-priceSignAttachment' # 231价格跟签供应商生成报价单附件优化 released
brsjglFj='hotfix-1.7.17' # AB设计类关联请示文件自动带出对应附件 released
brZBListUnderTakeAndAttatchments='fea-1.7-srm-ZBListUnderTakeAndAttatchments' # 承包方式和清单附件合并需求 包括 开标解密，招标清单审批时上报审批人 released
brListMaintain='feat-pricelist-maintain' # 价格跟签清单维护


# --------------------------------------------------
# brsrmftXX
# brsrmfxXX
# brcmpftXX
# brcmpfxXX
# --------------------------------------------------
brcmpftOfflineSign='feat-cmp-offline-sign' # 踏勘等节点允许切换线下签章 released
brsrmftK2Print='fea-1.8-srm-K2ReviewPrint' # K2流程表单打印 released 
brsrmfxTeamRole='hotfix-1.8.38' # 60445【设置招标团队】添加招标团队，不选择角色点击保存，默认了授权对象 released
brsrmftk2reviewStepsNav='fea-1.8-srm-K2ReviewStepsNav' # YTH-FS-SRM-001-审批流支持跳转查看2023.03.14_V1.0  released
brsrmftMergeBidingTask='fea-1.8-srm-mergeBidingTask' # 深化类的待招采任务允许合并招标 released
brsrmftCheckModelNumber='fea-1.8-srm-clhbCheckModelNumber' # 规格型号字段回车符自动替换成分号 released
brsrmftBqjdAttach='fea-1.8-srm-BQJDAttachment' # 标前交底附件模块，新增行和复制行默认全选供应商 released
brsrmfxCBWay='hotfix-1.9.21' # 招标清单承包方式模块编辑弹窗权限控制  后端控制不返回维护标底按钮, released 
brsrmftDBPriceList='fea-1.9-srm-DBPriceList' # 242定价-报价清单是否采用优化 released 
brsrmftConsultV2='fea-1.9-srm-consultV2' # 289请示流程功能二期优化 released 
brsrmftOpenBidDetail='fea-1.9-srm-OpenBidDetail' # 272开标-点击待办链接后跳转至开标明细页面 released
brsrmftZBTeamValidate='fea-1.9-srm-ZBTeamValidate' # 招标团队设置弹窗数据校验优化 released
brsrmftZBListFJ='fea-1.9-srm-ZBListFJ' # YTH-FS-SRM- 清单步骤增加附件栏位 released
brsrmftWinBidAllChecked='fea-1.9-srm-winBiddingAllCheck' # 材料招标定价步骤分项定标表格增加全选中标功能 released
brsrmftJianLiZBList='fea-1.9-srm-JianLiZBList' # 监理工程招标清单附件栏需求 released
brsrmftAutoSave='fea-1.9-srm-autoSave' # 招标过程立项和投标文件的步骤切换tab自动保存
brsrmftThousandPoint='fea-1.10-srm-thundrenPoint' # 金额面积字段支持千分位 released 
brcmpfxBrandMatch='fix-cmp-brandMatch' # 零星218供应商品牌后端去重导致校验失败 released
brsrmfxDBFujian='hotsrm-DBFujian' # 定标附件栏错误 released

brsrmftTodoJumpDetail='fea-1.10-srm-todoJumpDetail' # 深化模板变更需要给SRM报价 released 
brsrmfxApprovMix='hotfix-1.10.4' # bugID=63987定标审批流程表单内容为空 需优化K2的技术方案 released
brsrmfxConsultRename='fea-1.10-srm-consult-rename' # 请示类型名称修改 released 
brsrmftBZJOptimize='fea-1.10-srm-BZJOptimize' # 344 保证金功能调整 released 
brcmpftBZJOptimize='feat-cmp-BZJOptimize' # 344 保证金功能调整 released 
brbothftBZJOptimize='feat-both-BZJOptimize' # 344 保证金功能调整 both feature  released
brcmpftBaoXishuValidate='feat-cmp-Baoxishu-validate' # 报价信息报系数校验系数和税率是否填写 released
brsrmfxKJDiscardBid='fix-srm-discardBid-kejian' # 64599 生产优先处理【SRM】科建的招采方案废标的操作，触发了房产的流程 released
brsrmftConsultTitle='feat-srm-consultTypeTitle' # 修改请示类型的名称 released
brcmpftPinPaiAdjust='feat-cmp-pinpaiAdjust' # 348 应商回标增加批量录入品牌功能 released

brsrmftTBH='feat-srm-TBH' # 317 投标函 released
brsrmftUnbalance='feat-srm-unbalance' # 315 定标阶段，取消施工方在ISP确认不平衡文件的节点 released
brsrmftOrgAdjust='feat-srm-orgAdjust' # 364 组织调整专项  released
brsrmfxPingbiaoDown='hotfix-srm-pingbiaoDown-65634' # 评技术标节点下载预览无回 released
brsrmftOCRDiff='feat-srm-ocr-diff' # 241 开标时OCR有差异提醒采购员确认 released
brcmpfxHBFJCheck='hotfix-cmp-hbfj-check' # 65559 回标附件校验需校验多个标段的 released 
brcmpfxDYDGFile='hotfix-cmp-DYDGFile' # 66184 答疑定稿件增加查看按钮，显示文件列表 released
brsrmftJLOptimize='feat-srm-JLOptimize' # 375 监理工程优化需求 released
brsrmftOrderChange='feat-srm-order-change' # 349 订单变更指定供应商 released
brsrmftConsultK2Param='feat-srm-consult-k2param' # 277 请示流程参数 released
brcmpftAdjustHB='feat-cmp-adjust-hb' # 283 调整ISP回标、SRM评标和招审表表单内容及逻辑 released
brsrmftITZhaobiao='feat-srm-it-zhaobiao' # 50 IT招标（不含比价） released
brsrmftBiJia='feat-srm-bijia' # 347 比价分析按含税价分析 released
brsrmftSZSimpleZB='feat-srm-sz-simple-zb' # 350 市政简易招标业务流程调整 released
brsrmfxHBtimeSubmit='feat-srm-fix-hbtime-submit' # 67088 【材料类专项回归】修改回标截止时间驳回后，从变更记录查看弹窗点击提交审批失败 >>>转需求，流程编码待定.. released
brsrmftSZSimplify='feat-srm-sz-simplify' # 350 市政简易流程 released
brsrmftDiscardBidResult='feat-srm-discard-bid-result' # 零星271 作废定标结果 released
brsrmftBZJFieldOrder='feat-srm-bzj-fieldorder' # 保证金字段顺序调整 released
brsrmftZBListAuth='feat-srm-zblist-auth' # 370 招标列表查看编辑逻辑优化 released
brcmpftDYupload='feat-cmp-dyupload' # 299 答疑定稿件乙方回传问题解决 released
brcmpftHBOptimize='feat-hboptimize-0726' # 工程回标优化 released
brcmpftQibiaoImport='feat-cmp-qibiao-import' # 零星203 材料回标材料回标导入是否弃标不生效 released




# git
alias gpl='git pull --no-edit && git log --oneline -5'

# ssh port
port="8000"
myserver="124.223.215.179"
alias  portR="ssh -R ${port}:localhost:3000 pan@${myserver}"

# cmd
alias ngdir='cd /D/downloads/nginx-1.24.0 && ls'

alias allprojectDir='cd /d/bgy/projects'
alias mwksrm="cd /d/bgy/projects/group-integrationiplatform-srm"
alias mwkmain="cd /d/bgy/projects/group-integrationiplatform-main"
alias mwkco="cd /d/bgy/projects/group-integrationiplatform-co"
alias mwkint="cd /d/bgy/projects/group-integrationiplatform-integration"

alias gwk="cd /d/bgy/projects/group-integrationiplatform-frontend-giting"
alias gwksrm="cd /d/bgy/projects/group-integrationiplatform-frontend-giting/projects/yth-srm && pwd"

alias Agwk="cd /d/bgy/projects/yth-srm-giting"
alias Agwksrm="cd /d/bgy/projects/yth-srm-giting/projects/yth-srm && pwd"

alias nwk="cd /d/bgy/projects/group-integrationiplatform-frontend-working"
alias nwkint="nwk && cd projects/yth-integration"
# alias nwksrm="cd /d/bgy/projects/group-integrationiplatform-frontend-working/projects/yth-srm && pwd"
alias nwksrm="cd /d/bgy/projects/yth-srm-working/projects/yth-srm && pwd"
alias nwkmain="cd /d/bgy/projects/group-integrationiplatform-frontend-working/projects/yth-integration && ls ."
alias nwkcontract='cd /d/bgy/projects/group-contractmanagement-frontend'


wkgysDir="/d/bgy/projects/gys-frontend"
alias wkgys="cd $wkgysDir"

alias dwkco='wk srm && cd ../group-integrationiplatform-co'
alias dwksrm='wk srm && cd ../group-integrationiplatform-srm'
alias dwkint='wk srm && cd ../group-integrationiplatform-integration'

alias awksrm='cd /d/bgy/projects/yth-srm'
alias aintworking='cd /d/bgy/projects/yth-integration-working'
alias aworkingsrm='cd /d/bgy/projects/yth-srm-working'
alias awkissrm='cd /d/bgy/projects/yth-srm-working/projects/yth-srm'
alias wlibsrm='awkissrm && yarn wlib:prod'
alias agitingsrm='cd /d/bgy/projects/yth-srm-giting'
alias aintgiting='cd /d/bgy/projects/yth-integration-giting'
alias awkcost='cd /d/bgy/projects/yth-co'
alias awkint='cd /d/bgy/projects/yth-integration'

alias pkhome='cd /d/packages'

alias srm="wk srm && yarn start:srm"
# alias nsrm="nwk && yarn start:srm" # 不用sit环境，暂时禁用，执行 nsrmuat, 不然k2 域名不对
alias nsrmuat="nwksrm && winpty yarn.cmd start:srm-uat"
alias nsrmquat="nwksrm && winpty yarn.cmd qstart:srm-uat"
alias nintquat="aworkingint && cd projects/yth-integration &&  winpty yarn.cmd qstart:int-uat"
alias nispquat="nwksrm && winpty yarn.cmd qstart:isp-uat"
alias nsrmprod="nwksrm && winpty yarn.cmd start:srm-prod"

alias ncontract="nwkcontract && yarn start"
alias nmain="nwkmain && yarn start"
alias nint="nmain"

alias gys="wkgys && yarn start:outer"

alias mmain='mwkmain && yarn serve:main'
alias msrm='mwksrm && yarn start:srm'
alias mco='mwkco && yarn start'
alias mint='mwkint && yarn serve:int'


alias mypython='winpty python'
alias ptyvue='winpty vue.cmd'

alias qkmain='nwkmain && yarn dev'
alias qksrm='dwksrm && yarn start:srm'
alias qkco='dwkco && yarn serve:co'
alias qkcontract='nwkcontract && yarn dev'


# my
alias learn="cd /d/work/learns"
alias mydev='cd /d/mydev'
alias tmpdir='cd ~/tmp'
alias fac='mydev && cd factory-backend && yarn dev'
alias wkfac='mydev && cd factory-backend' 
alias cool='cd /d/my/coolfe'
lnx='10.181.33.208'



source ~/build-cmp.sh


# helper
# ----------------------------------------------------------
function hfixmg() {
	usage 1 ${#@} "hotfix srm | isp" || return 1
	local project="$1"
	gwk
	if [ $project = 'srm' ]; then
		gco prod && gp --no-edit || return 1
		mergeBranch prod $brhotfixsrm || return 1
	else
		gcorelease && gp --no-edit || return 1
		mergeBranch $brrelease $brhotfixisp || return 1
	fi

	# nsrmprod
}

function hotfix() {
	usage 1 ${#@} "hotfix srm | isp" || return 1
	local project="$1"
	nwk
	if [ $project = 'srm' ]; then
		gco prod && gp --no-edit || return 1
		mergeBranch prod $brhotfixsrm || return 1
	else
		gcorelease && gp --no-edit || return 1
		mergeBranchdData $brrelease $brhotfixisp || return 1
	fi

	nsrmprod
}

function ispUpdatesrm() {
	usage 1 ${#@} "ispUpdatesrm <dev|uat|latest>"  || return 1
	# if [ "${#@}" -lt 1 ]; then
	# 	echo usage: ispUpdatesrm dev / uat 
	# 	return 1
	# fi

	tag="$1"

	lnlog "tag is $tag"

	wkgys
	pnpm install $srmpkg@$tag -w
}

function ispustart() {
	wkgys
	yarn start:outer:uat
}

function ispilocalsrm() {
	wkgys
	pnpm install ../yth-srm-working/projects/yth-srm/lib/prod -w
}

function isppstart() {
	local force="$1"
	wkgys
	if [ -z "$force" ]; then

	   yarn start:outer:prod
	else
	   yarn start:outer:prodforce
	fi

}


function sshportRemote() {
	echo "publish server to : http://${myserver}:${port}"
	portR
}

function mgsbuat() {
	usage 1 ${#@} "mgsbuat <featBranch>" || return 1

	gwk

	local featBranch="$1"
	checkoutBranch $featBranch || return 1
	checkoutBranch uat || return 1

	mergeBranch $featBranch uat || return 1

	lnlog "成功合并, 准备推送到远端..."

	gco uat
	gpp

	sbauat

	gwk
}


function mgtouat() {
	usage 0 ${#@} 'mgtouat [featbranch]' || return 1
	lnlog "当前目录是 $(pwd) "

	local featbranch="$1"

	if [ -z "$featbranch" ]; then
		featbranch="$(getCurbranch)"
	fi

	checkoutBranch $featbranch || return 1
	checkoutBranch uat || return 1

	mergeBranch $featbranch uat yes || return 1

	lnlog "uat分支 推送远端.."

	gapp

	gco $featbranch

}

function mgtobuild() {
	usage 0 ${#@} 'mgtobuild [featbranch]' || return 1
	lnlog "当前目录是 $(pwd) "

	local featbranch="$1"

	if [ -z "$featbranch" ]; then
		featbranch="$(getCurbranch)"
	fi
	
	checkoutBranch $featbranch || return 1
	checkoutBranch cmp-build || return 1

	mergeBranch $featbranch cmp-build yes || return 1

	lnlog "cmp-build 分支 推送远端.."

	gapp

	gco $featbranch

}

function ubprodboth() {
	agitingsrm
	checkoutBranch prod || return 1
	checkoutBranch cmp-release || return 1
	checkoutBranch prod-both || return 1
	mergeBranch  prod prod-both yes || return 1
	mergeBranch cmp-release prod-both yes || return 1
	gco prod-both
	gpp
	lnlog "更新分支 prod-both 成功"
}

function cfix() {
	usage 1 ${#@} "cfix <sit | uat | prod> [featbranch]" || return 1

	# gwk
	Agwk
	
        local featBranch=""

	if [ -z "$2" ]; then
		featBranch=$(getCurbranch)
	else
                featBranch="$2"
	fi
		
	local branch="$1"
	local fixBranch="${1}-conflict-panzj"

	checkoutBranch $branch || return 1
	checkoutBranch $fixBranch || return 1

	mergeBranch $branch $fixBranch || return 1

	pullAndPushBranch $fixBranch || return 1

	echo "同步成功! $branch --> $fixBranch "

	checkoutBranch $featBranch || return 1
	gco $fixBranch
	gm $featBranch

}


function fixok() {
	usage 1 ${#@} "fixok <sit | uat>" || return 1

	local branch="$1"
	if [ "$branch" == "prod" ]; then
		echo "should not merge to prod directly"
		return 1
	fi

	
	local fixBranch="${1}-conflict-panzj"

	checkoutBranch $fixBranch || return 1
	checkoutBranch $branch || return 1

	mergeBranch $fixBranch $branch || return 1


	pullAndPushBranch $branch || return 1


	echo "同步分支成功! 修复冲突,  $fixBranch --> $branch"

}


function mupsit() {
	mwksrm

	gco sit
	gp
	gb -D msit

	git fetch upstream sit
	gco -b msit upstream/sit

	rm -rf projects/yth-co projects/yth-integration
	gcma "chord: 同步源仓库sit修改, 去掉其他子应用"
	gpp
        
	gco sit
	gm msit --no-edit

        git pull --no-edit
	git push

}


# 同步分支 master
function sbamaster() {
	awksrm
	
	gco up-master
	git pull upstream master:up-master
	gco master 
	git pull --no-edit
	gm up-master --no-edit
	git push

	lnlog "独立仓库 master 分支同步完毕"
}


# 同步分支 prod
function sbaprod() {
	awksrm
	
	gco up-prod
	git pull upstream prod:up-prod
	gco prod 
	git pull --no-edit
	gm up-prod --no-edit
	git push

	lnlog "独立仓库 prod 分支同步完毕"
}



# 同步分支 uat
function sbauat() {
	awksrm
	
	gco up-uat
	git pull upstream uat:up-uat
	gco uat
	git pull --no-edit
	gm up-uat --no-edit
	git push

	lnlog "独立仓库 uat 分支同步完毕"
}

# 同步分支 
function sbabranch() {
	usage 1 ${#@} "sbabranch <branch> <pkname>" || return 1
	pkname="${2-srm}"

	if [ $pkname == 'int' ]; then
		awkint
	elif [ $pkname == 'cost' ]; then
		awkcost
	elif [ $pkname == 'srm' ]; then
		awksrm
	elif [ $pkname == 'pwd' ]; then
		lnlog "在当前目录 $(pwd) 同步源仓库的分支.."
	else
		lnlog "unknown option ${pkname}"
		return 1
	fi

	local branch="$1"
	local upbranch="up-$1"
	git branch | grep -E "^\*?\s*${branch}$" > /dev/null
	if [ $? -gt 0 ]; then
		lnlog "本地没有 $branch 分支，从upstream远端检出..."
		git fetch upstream $branch
		lnlog "' git fetch upstream $branch ' called ------------------> $? "
		git checkout -b $branch upstream/$branch
		# git pull upstream $branch:$branch --no-edit
		if [ $? -gt 0 ]; then
			lnlog "拉取upstream分支失败.."
			return 1
		fi
		gco $branch
		gco -b $upbranch 
		git push -u origin $branch:$branch
	fi
	
	gco $upbranch 
	# 应该不支持 git pull origin src:dst 这样的语法
	# git pull upstream $branch:$upbranch
	git fetch upstream $branch
	git merge upstream/$branch
        if [ $? -gt 0 ]; then
		lnlog "分支合并失败: upstream/$branch -> $upbranch"
		return 1
	else
		lnlog "$upbranch 同步upstream来源分支成功,"
	fi

	gco $branch 
	git pull --no-edit
	gm $upbranch --no-edit
        if [ $? -gt 0 ]; then
		lnlog "分支合并失败: $upbranch -> $branch"
		return 1
	else
		lnlog "分支合并成功: $upbranch -> $branch"
	fi
	git push

	lnlog "独立仓库 $branch 分支同步完毕"
}

# 同步所有开发分支
function sballDevbranch() {
	for val in `cat ~/devbranchs.txt`
	do
		sbabranch $val
		if [ $? -gt 0 ]; then
		  return 1
		fi
	done
}


# 同步所有开发分支
function sballcostDevbranch() {
	for val in `cat ~/cost-devbranchs.txt`
	do
		sbabranch $val cost
		if [ $? -gt 0 ]; then
		  return 1
		fi
	done
}


# 同步所有开发分支
function sballintDevbranch() {
	for val in `cat ~/int-devbranchs.txt`
	do
		sbabranch $val int
		if [ $? -gt 0 ]; then
		  return 1
		fi
	done
}



function dotp() {
	. ~/.profile
}

function vimp() {
	vim ~/.profile
}


function downpkg() {

	if [ ${#@} -lt 2 ]; then
		echo "usage: downpkg name version"
		return 1
	fi

	pkhome

	local name="$1"
	local version="$2"
	local fname="${name}-${version}.tgz"
	local dname=`echo $fname | sed "1s/\.tgz//"`
	echo $dname
	ls $dname >& /dev/null

	if [ $? -gt 0 ]; then
		mkdir $dname
	fi


	local baseUrl="https://npm.countrygarden.com.cn/${name}/-/"
	local url="${baseUrl}${fname}"
	
	echo "::: downloading: $url"

	curl -o $fname $url 
	tar -xvzf $fname -C $dname
	code $dname
}

function mylog() {
        # gwksrm	
	git log --author pan --since "`date +%Y-%m-%d` 0:0:0" --oneline | grep -vi "merge\|release" | sed "s/^[0-9a-zA-Z :]\{1,\}//g"
}

function getCurbranch() {
	echo $(git rev-parse --abbrev-ref HEAD)
}

function gpnew() {

	if [ -n "$1" ]; then
		local branch="$1"
	else
		local branch=$(git rev-parse --abbrev-ref HEAD)
	fi

	cmd="git push -u origin $branch:$branch"
	echo "::: $cmd"
	$cmd
}


function pkinfo() {
	usage 1 ${#@} "pkinfo {packageShortName}" || return 1
	npm info gys-external-${1}
}

function lsbranchvar() {
	for var in `echo ${!br*}`
	do
		echo $var: ${!var}
	done
}

function grepbranchvar() {
	grep -E "^br" ~/.profile
}

function cpBundlesToIspNodeModules() {

	usage 1 ${#@} "cpBundlesToIspNodeModules <uat|prod>" || return 1

	local curdir=`pwd`
	local env="$1"

	# clear
	wkgys

	local srmModuleDir="${wkgysDir}/node_modules/gys-external-srm/lib"
	
	lnlog "正在清理 $srmModuleDir ...."

	mkdir -p $srmModuleDir
	rm -rf $srmModuleDir/*

	# copy
	aworkingsrm;

	lnlog "准备复制文件，源文件夹为：projects/yth-srm/lib/$env/"  
	cp -r projects/yth-srm/lib/$env/* $srmModuleDir

	lnlog "新文件列表:"

	ll -R $srmModuleDir

	lnlog "copy bundles done!!"

	cd $curdir;
}

function cphtbundles() {
	allpjdir
	cp group-contractmanagement-frontend/lib/uat/*component.css group-contractmanagement-frontend/lib/uat/*umd.js gys-external-contract-editor/lib/
	lnlog '复制完成'

	ll -h gys-external-contract-editor/lib
	cd gys-external-contract-editor
}


function gcmtask() {
	usage 1 "${#@}" 'gcmtask <msg>' || return 1
	local msg="$1"
	local other="$2"
	git commit -a -m "task#${taskId}: ${msg}" $other
}

function gcmbug() {
	usage 2 "${#@}" 'gcmbug <bugId> <msg>' || return 1
	local bugId="$1"
	local msg="$2"
	git commit -a -m "bug#${bugId}: ${msg}"
}




alias mynginx='cd /d/downloads/nginx-1.24.0 && ./nginx'

function inrelease() {
	usage 1 "${#@}" 'inrelease <commitid>' || return 1
	git branch --contains $1 | grep cmp-release 
	if [ $? -eq 0 ]; then
		echo "yes"
	else
		echo "no"
	fi
}

function inprod() {
	usage 1 "${#@}" 'inprod <commitid>' || return 1
	git branch --contains $1 | grep prod
	if [ $? -eq 0 ]; then
		echo "yes"
	else
		echo "no"
	fi
}

function inboth() {
	usage 1 "${#@}" 'inboth <commitid>' || return 1
	inprod $1
	echo '----------------------'
	inrelease $1
}

function gcogl() {
	gco $1 ; glmol -11
}

function chktask() {
	usage 1 "${#@}" "chktask msg" || return 1
	# gl --oneline --grep "$1" > /dev/null
	result=`gl --oneline --grep "$1"`
	echo $result
	if [ -z "$result" ]; then
		echo "no -------------> $1  "
		echo $1 >> ~/notask.txt
	else
		# echo "yes --------------> $1 "
		echo "yes "
	fi
}

export chktask

function chkmsg() {
	usage 1 "${#@}" "chkmsg msg" || return 1
	# gl --oneline --grep "$1" > /dev/null
	result=`gl --oneline --grep "$1"`
	echo $result
	if [ -z "$result" ]; then
		echo "no -------------> $1  "
		echo $1 >> ~/nomsg.txt
	else
		echo "yes --------------> $1 "
	fi
}

export chkmsg

